ci: defer release-please PR creation while a draft release is pending - #3108
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
After every release-PR merge, release-please opens a bogus next-version PR whose changelog regenerates from a months-old base (#3096 after 7.1.0, #3107 after 7.1.1).
Root cause
Our releases start as drafts (electron-builder can only upload signed artifacts to a draft), and a draft release has no git tag until the publish pipeline flips it ~15 minutes later. release-please's single invocation creates the draft and then immediately runs its release-PR phase: with the manifest already at the new version but no matching tag (googleapis/release-please#1650), it finds no anchor and regenerates a "next release" from its full search window - hence a 7.2.0 PR re-listing features from May. Any push to
mainduring the draft window does the same. Once the tag exists, later runs report "no user facing commits - skipping" and never clean the stale PR up.Fix
Split release-please into two phased steps inside the existing job:
skip-github-pull-request: true) - unchanged behavior for release creation; keeps therelease_created/tag_nameoutputs the downstream jobs consume.skip-github-release: true), run only when there are no pending drafts - i.e. the previous release's tag exists and a correct anchor is available.The next release PR is then created on the first push to
mainafter the draft publishes, which is the earliest moment it can be generated correctly anyway. A permanently stuck draft intentionally pauses release-PR creation until it is resolved, which is the safe behavior (see 7.1.0's stuck draft).Validated with
actionlintandzizmor(both clean).Note: #3107 still needs to be closed manually once v7.1.1 publishes; this change prevents recurrence, it does not clean up existing stale PRs.